package com.vf.activity.controller;

import com.vf.common.annotation.Anonymous;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.vf.common.annotation.Log;
import com.vf.common.core.controller.BaseController;
import com.vf.common.core.domain.AjaxResult;
import com.vf.common.enums.BusinessType;
import com.vf.activity.service.IActivityAppService;

/**
 * 活动参与申请Controller
 * 
 * @author LBS
 * @date 2025-06-04
 */
@RestController
@RequestMapping("/activity/activityA")
@Api(tags="活动参与申请")
public class ActivityAppController extends BaseController
{
    @Autowired
    private IActivityAppService activityApplicationsService;

//    /**
//     * 查询活动参与申请列表
//     */
//    @PreAuthorize("@ss.hasPermi('activity:activityApplications:list')")
//    @GetMapping("/list")
//    public TableDataInfo list(ActivityApplications activityApplications)
//    {
//        startPage();
//        List<ActivityApplications> list = activityApplicationsService.selectActivityApplicationsList(activityApplications);
//        return getDataTable(list);
//    }
//
//    /**
//     * 导出活动参与申请列表
//     */
//    @PreAuthorize("@ss.hasPermi('activity:activityApplications:export')")
//    @Log(title = "活动参与申请", businessType = BusinessType.EXPORT)
//    @PostMapping("/export")
//    public void export(HttpServletResponse response, ActivityApplications activityApplications)
//    {
//        List<ActivityApplications> list = activityApplicationsService.selectActivityApplicationsList(activityApplications);
//        ExcelUtil<ActivityApplications> util = new ExcelUtil<ActivityApplications>(ActivityApplications.class);
//        util.exportExcel(response, list, "活动参与申请数据");
//    }
//
//    /**
//     * 获取活动参与申请详细信息
//     */
//    @PreAuthorize("@ss.hasPermi('activity:activityApplications:query')")
//    @GetMapping(value = "/{applicationId}")
//    public AjaxResult getInfo(@PathVariable("applicationId") Long applicationId)
//    {
//        return success(activityApplicationsService.selectActivityApplicationsByApplicationId(applicationId));
//    }
//
//    /**
//     * 新增活动参与申请
//     */
//    @PreAuthorize("@ss.hasPermi('activity:activityApplications:add')")
//    @Log(title = "活动参与申请", businessType = BusinessType.INSERT)
//    @PostMapping
//    public AjaxResult add(@RequestBody ActivityApplications activityApplications)
//    {
//        return toAjax(activityApplicationsService.insertActivityApplications(activityApplications));
//    }
//
//    /**
//     * 修改活动参与申请
//     */
//    @PreAuthorize("@ss.hasPermi('activity:activityApplications:edit')")
//    @Log(title = "活动参与申请", businessType = BusinessType.UPDATE)
//    @PutMapping
//    public AjaxResult edit(@RequestBody ActivityApplications activityApplications)
//    {
//        return toAjax(activityApplicationsService.updateActivityApplications(activityApplications));
//    }
//
//    /**
//     * 删除活动参与申请
//     */
//    @PreAuthorize("@ss.hasPermi('activity:activityApplications:remove')")
//    @Log(title = "活动参与申请", businessType = BusinessType.DELETE)
//	@DeleteMapping("/{applicationIds}")
//    public AjaxResult remove(@PathVariable Long[] applicationIds)
//    {
//        return toAjax(activityApplicationsService.deleteActivityApplicationsByApplicationIds(applicationIds));
//    }

    /**
     * 查询待审核的申请
     * @param userId
     */
    @Log(title = "查询待审核的申请", businessType = BusinessType.DELETE)
    @GetMapping("/getActivityAppByUserId")
    @ApiOperation(value = "查询待审核的申请")
    @Anonymous
    public AjaxResult getActivityApplicationsByUserId(Long userId)
    {
        return success(activityApplicationsService.getActivityApplicationsByUserId(userId));
    }

    /**
     * 查询我的活动
     * @param userId
     */
    @Log(title = "查询我的活动", businessType = BusinessType.DELETE)
    @GetMapping("/getActivityByUserId")
    @ApiOperation(value = "查询我的活动")
    @Anonymous
    public AjaxResult getActivityByUserId(Long userId)
    {
        return success(activityApplicationsService.getActivityByUserId(userId));
    }

    /**
     * 查询我参加的活动
     * @param userId
     */
    @Log(title = "查询我参加的活动", businessType = BusinessType.DELETE)
    @GetMapping("/getActivityJoinByUserId")
    @ApiOperation(value = "查询我参加的活动")
    @Anonymous
    public AjaxResult getActivityJoinByUserId(Long userId)
    {
        return success(activityApplicationsService.getActivityJoinByUserId(userId));
    }

    /**
     * 查询我预约的活动
     * @param userId
     */
    @Log(title = "查询我预约的活动", businessType = BusinessType.DELETE)
    @GetMapping("/getActivityJoinByUserId2")
    @ApiOperation(value = "查询我预约的活动")
    @Anonymous
    public AjaxResult getActivityPByUserId(Long userId)
    {
        return success(activityApplicationsService.getActivityPByUserId(userId));
    }

    /**
     * 通过申请
     */
    @Anonymous
    @ApiOperation(value = "通过申请")
    @Log(title = "通过申请", businessType = BusinessType.UPDATE)
    @PutMapping("/pass")
    public AjaxResult updateActivityApplicationsPass(Long applicationId)
    {
        return toAjax(activityApplicationsService.updateActivityApplicationsPass(applicationId));
    }

    /**
     * 拒绝申请
     */
    @Anonymous
    @ApiOperation(value = "拒绝申请")
    @Log(title = "拒绝申请", businessType = BusinessType.UPDATE)
    @PutMapping("/noPass")
    public AjaxResult updateActivityApplicationsNoPass(Long applicationId)
    {
        return toAjax(activityApplicationsService.updateActivityApplicationsNoPass(applicationId));
    }


}
